package com.itheima.project.face.impl;

import com.itheima.project.adapter.BasicPayAdapter;
import com.itheima.project.exception.ProjectException;
import com.itheima.project.face.BasicPayFace;
import com.itheima.project.vo.trade.RefundRecordVo;
import com.itheima.project.vo.trade.TradingVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName BasicPayFaceImpl.java
 * @Description TODO
 */
@Component
public class BasicPayFaceImpl implements BasicPayFace {

    @Autowired
    BasicPayAdapter basicPayAdapter;

    @Override
    @Transactional
    public TradingVo queryTrading(TradingVo tradingVo) throws ProjectException {
        return basicPayAdapter.queryTrading(tradingVo);
    }

    @Override
    @Transactional
    public TradingVo refundTrading(TradingVo tradingVo) throws ProjectException {
        return basicPayAdapter.refundTrading(tradingVo);
    }

    @Override
    @Transactional
    public void queryRefundTrading(RefundRecordVo refundRecordVo) throws ProjectException {
        basicPayAdapter.queryRefundTrading(refundRecordVo);
    }
}
